<template>
  <div class="news">
 
    
  <el-table :data="tableData2" stripe style="width: 100%">
    <el-table-column prop="ctime" label="时间" width="180" />
    <el-table-column prop="title" label="事件" width="180" />
    <el-table-column prop="source" label="来源" />
  </el-table>

  </div>
</template>
<script>
import {news} from"../../api/dataapi.js"
import {reactive,toRefs,onMounted} from "vue"
export default {
    setup(){
    const data1 =reactive({
     tableData2:[],
    
   });
   let getData =()=>{
       news().then(r=>{
           data1.tableData2 = r.data.newslist
           console.log(data1.tableData2);
       })
   }
onMounted(()=>{
    getData()
})
   return{
   ...toRefs(data1)
   }
    }
}
</script>
<style scoped>
.news{
    width: 900px;
}
</style>